/*
 * This file is part of aion-engine <aion-engine.com>
 *
 * aion-engine is private software: you can redistribute it and or modify
 * it under the terms of the GNU Lesser Public License as published by
 * the Private Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * aion-engine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser Public License for more details.
 *
 * You should have received a copy of the GNU Lesser Public License
 * along with aion-engine.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.aionengine.gameserver.model.gameobjects;

import com.aionengine.gameserver.controllers.NpcController;
import com.aionengine.gameserver.model.CreatureType;
import com.aionengine.gameserver.model.house.House;
import com.aionengine.gameserver.model.templates.npc.NpcTemplate;
import com.aionengine.gameserver.model.templates.spawns.SpawnTemplate;

/**
 * @author Rolandas
 */
public class SummonedHouseNpc extends SummonedObject<House> {

    String masterName;

    public SummonedHouseNpc(int objId, NpcController controller, SpawnTemplate spawnTemplate, NpcTemplate npcTemplate, House house,
                            String masterName) {
        super(objId, controller, spawnTemplate, npcTemplate, npcTemplate.getLevel());
        setCreator(house);
        this.masterName = masterName;
    }

    @Override
    public int getCreatorId() {
        return getCreator().getAddress().getId();
    }

    @Override
    public String getMasterName() {
        return masterName;
    }

    @Override
    public int getType(Creature creature) {
        return CreatureType.FRIEND.getId();
    }

    @Override
    public Creature getMaster() {
        // Not interesting, player may be offline
        return null;
    }

}
